require.config({
  baseUrl: '.',
  paths: {
    angular: '..//node_modules/angular/angular',
    angularRoute: '..//node_modules/angular-route/angular-route',
    app: 'app',
    doneCountFilter: 'filters/doneCount.filter',
    todoService: 'services/todo.service',
    todoHeaderDir: 'directives/todoHeader.directive',
    todoBodyDir: 'directives/todoBody.directive',
    todoFooterDir: 'directives/todoFooter.directive',
    todoController: 'controllers/todo.controller',
    archivedController: 'controllers/archived.controller'
  },
  shim: {
    angular: {
      deps: [],
      exports: 'angular'
    },
    angularRoute: {
      deps: ['angular']
    }
  }
});

require(['angular', 'app'], function(angular, app) {
  require([
    'doneCountFilter',
    'todoService',
    'todoHeaderDir',
    'todoBodyDir', 
    'todoFooterDir',
    'todoController',
    'archivedController'
  ], function() {
    angular.bootstrap(document.body, [app.name]);
    console.log('done');
  });
});